package com.atty.dms.service;

import com.atty.dms.dao.entity.DormitoryDO;
import com.atty.dms.dao.entity.DormitoryStudentDO;
import com.atty.dms.dto.req.DormitoryStudentCFReqDTO;
import com.atty.dms.dto.req.DormitoryStudentCreateReqDTO;
import com.atty.dms.dto.req.DormitoryStudentUpdateReqDTO;
import com.atty.dms.dto.resp.DormitoryStudentDetailPageRespDTO;
import com.atty.dms.dto.resp.DormitoryStudentPageRespDTO;
import com.atty.dms.dto.resp.DormitoryStudentRespDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * ClassName:DormitoryStudentService
 * Package:com.atty.dms.service
 * Description:
 *
 * @Author:tony
 * @Create :2025/4/22 9:28
 * @Version :1.0
 */
public interface DormitoryStudentService extends IService<DormitoryStudentDO> {

    /**
     * 手动创建宿舍学生分配记录
     * @param requestParam
     */
    void assignDormitoryStudent(DormitoryStudentCreateReqDTO requestParam);

    /**
     * 根据宿舍id获取宿舍内学生分配记录
     * @param dormitoryId
     * @return
     */
    List<DormitoryStudentRespDTO> getDormitoryStudentByDormitoryId(Long dormitoryId);

    /**
     * 根据学生id获取宿舍内学生分配记录
     * @param studentId
     * @return
     */
    DormitoryStudentRespDTO getDormitoryStudentByStudentId(Long studentId);

    /**
     * 更改学生宿舍信息
     * @param requestParam
     */
    void updateDormitoryStudent(DormitoryStudentUpdateReqDTO requestParam);

    /**
     * 删除学生宿舍信息
     * @param studentId
     */
    void deleteDormitoryStudent(Long studentId);

    /**
     * 交换宿舍
     * @param studentIdA
     * @param studentIdB
     */
    void exchangeDormitoryStudent(Long studentIdA, Long studentIdB);

    /**
     * 协同过滤算法分配宿舍
     * @param requestParam
     */
    DormitoryDO assignDormitoryByCollaborativeFiltering(DormitoryStudentCFReqDTO requestParam);

    /**
     * 协同过滤算法批量分配宿舍
     * @param requestParams
     */
    void assignDormitoriesByCollaborativeFiltering(List<DormitoryStudentCFReqDTO> requestParams);

    /**
     * 分页获取所有宿舍学生分配记录
     * @return
     */
    Page<DormitoryStudentDetailPageRespDTO> getAllDormitoryStudentDetailByPage(int pageNum, int pageSize);
}
